-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added firebird database type and parser module #33773
Added firebird database type and parser module #33773
Conversation
Co-authored-by: vasilevskyy <marvo.rate2016@yandex.ru>
Great job, I will review soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks so great, merged.
@Override | ||
public ConnectionProperties parse(final String url, final String username, final String catalog) { | ||
JdbcUrl jdbcUrl = new StandardJdbcUrlParser().parse(url); | ||
return new StandardConnectionProperties(jdbcUrl.getHostname(), jdbcUrl.getPort(DEFAULT_PORT), jdbcUrl.getDatabase(), null, jdbcUrl.getQueryProperties(), new Properties()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I noticed a potential issue with the current PR while investigating the fallout from Improve GraalVM Reachability Metadata and corresponding nativeTest related unit tests #29052 .
- Why use
org.apache.shardingsphere.infra.database.core.connector.url.StandardJdbcUrlParser
instead of using a class provided by the database driver, such asorg.apache.hive.jdbc.Utils
, as in https://github.com/apache/shardingsphere/blob/master/infra/database/type/hive/src/main/java/org/apache/shardingsphere/infra/database/hive/connector/HiveConnectionPropertiesParser.java ? - The current PR causes URLs like
jdbc:firebird://localhost:32783//var/lib/firebird/data/demo_ds_2.fdb
to not be recognized.
[ERROR] 2025-01-11 10:20:35.235 [main] com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Exception during pool initialization.
org.apache.shardingsphere.infra.database.core.exception.UnrecognizedDatabaseURLException: The URL `jdbc:firebird://localhost:32783//var/lib/firebird/data/demo_ds_2.fdb` is not recognized, please refer to the pattern `(?<schema>[\w-.+:%%]+)\s*(?://(?<authority>[^/?#]*))?\s*(?:/(?!\s*/)(?<path>[^?#]*))?(?:\?(?!\s*\?)(?<query>[^#]*))?`.
at org.apache.shardingsphere.infra.database.core.connector.url.StandardJdbcUrlParser.lambda$parse$0(StandardJdbcUrlParser.java:58)
at org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions.checkState(ShardingSpherePreconditions.java:44)
at org.apache.shardingsphere.infra.database.core.connector.url.StandardJdbcUrlParser.parse(StandardJdbcUrlParser.java:58)
at org.apache.shardingsphere.infra.database.firebird.connector.FirebirdConnectionPropertiesParser.parse(FirebirdConnectionPropertiesParser.java:37)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made further changes in #34307.
Fixes #33699.
Changes proposed in this pull request:
Before committing this PR, I'm sure that I have checked the following options:
./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e
.